package com.dalin.platform.etl.action;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

import com.dalin.common.utils.StringUtils;
import com.dalin.framework.action.StrutsTwoAction;
import com.dalin.platform.etl.service.EtlService;
import com.dalin.platform.etl.vo.EtlColumnViewVo;
/*****************************************************************************
 * @content: 类信息                                                   *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-12-05 21:54:43                                                     *
 * @modDate: 2010-12-05 21:54:43                                                     *
 * @version: 1.00                                                           *
 ****************************************************************************/
public class ColumnViewFindAction extends StrutsTwoAction{
    private EtlService etlService; // 
    private Long columnId; // 

    public String execute() throws Exception {
        super.printInfo("", "===== this action begin");
		try {
			EtlColumnViewVo vo = etlService.findEtlColumnViewByColumnId(columnId);
			Map dataMap = new HashMap();
			Field[] fieldArr = vo.getClass().getDeclaredFields();
			for (Field f : fieldArr) {
				f.setAccessible(true);
				dataMap.put(f.getName(), StringUtils.toString(f.get(vo)));
			}
		//	setResContent(true, dataMap);
		} catch (Exception e) {
			e.printStackTrace();
			setResContent(e);
		}
        super.printInfo("", "===== this action end");
        return null;
    }


    public EtlService getEtlService() {
		return etlService;
	}


	public void setEtlService(EtlService etlService) {
		this.etlService = etlService;
	}


	public Long getColumnId() {
		return columnId;
	}


	public void setColumnId(Long columnId) {
		this.columnId = columnId;
	}
}
